package com.yellow.cloud.security.oauth2.client;

import com.yellowframework.cloud.common.annotation.FeignLogin;
import com.yellowframework.cloud.common.client.YellowCloudServerList;
import com.yellowframework.cloud.common.model.response.ResponseResult;
import com.yellowframework.cloud.domain.system.LoginLog;
import com.yellowframework.cloud.domain.system.SysDetailLog;
import com.yellowframework.cloud.domain.system.ext.SysUserExt;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = YellowCloudServerList.YELLOW_CLOUD_SYSTEM)
public interface SystemClient {

    @FeignLogin
    @PostMapping("/sys/loginlog")
    LoginLog saveLoginlog(@RequestBody LoginLog request);

    @FeignLogin
    @PostMapping("/sys/log/detaillog")
    ResponseResult saveDetaillog(@RequestBody SysDetailLog request);

    @FeignLogin
    @GetMapping("/sys/user/info")
    SysUserExt info(@RequestParam String username);

    @FeignLogin
    @PutMapping("/sys/user/lastlogintime")
    ResponseResult setLastLoginTime(@RequestParam String username);
}
